// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

using System;
using System.Threading;
using System.Threading.Tasks;

#nullable restore
namespace Elastic.Clients.Elasticsearch.Ssl
{
	public class SslNamespace : NamespacedClientProxy
	{
		internal SslNamespace(ElasticsearchClient client) : base(client)
		{
		}

		public SslCertificatesResponse Certificates(SslCertificatesRequest request)
		{
			request.BeforeRequest();
			return DoRequest<SslCertificatesRequest, SslCertificatesResponse>(request);
		}

		public Task<SslCertificatesResponse> CertificatesAsync(SslCertificatesRequest request, CancellationToken cancellationToken = default)
		{
			request.BeforeRequest();
			return DoRequestAsync<SslCertificatesRequest, SslCertificatesResponse>(request, cancellationToken);
		}

		public SslCertificatesResponse Certificates()
		{
			var descriptor = new SslCertificatesRequestDescriptor();
			descriptor.BeforeRequest();
			return DoRequest<SslCertificatesRequestDescriptor, SslCertificatesResponse>(descriptor);
		}

		public SslCertificatesResponse Certificates(Action<SslCertificatesRequestDescriptor> configureRequest)
		{
			var descriptor = new SslCertificatesRequestDescriptor();
			configureRequest?.Invoke(descriptor);
			descriptor.BeforeRequest();
			return DoRequest<SslCertificatesRequestDescriptor, SslCertificatesResponse>(descriptor);
		}

		public Task<SslCertificatesResponse> CertificatesAsync(CancellationToken cancellationToken = default)
		{
			var descriptor = new SslCertificatesRequestDescriptor();
			descriptor.BeforeRequest();
			return DoRequestAsync<SslCertificatesRequestDescriptor, SslCertificatesResponse>(descriptor);
		}

		public Task<SslCertificatesResponse> CertificatesAsync(Action<SslCertificatesRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
		{
			var descriptor = new SslCertificatesRequestDescriptor();
			configureRequest?.Invoke(descriptor);
			descriptor.BeforeRequest();
			return DoRequestAsync<SslCertificatesRequestDescriptor, SslCertificatesResponse>(descriptor);
		}
	}
}